import java.util.Scanner;
/**
 * Created with IntelliJ IDEA.
 * Description:
 * User:
 * Date: 2025-09-23
 * Time: 17:05
 */
public class demo1 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        int ret = 0;


        for(int i = a; i <= b; i++){
            int tmp = i;
            while(tmp != 0){
                if(tmp % 10 == 2) {
                    ret++;
                    System.out.println(i);
                }
                tmp /= 10;
            }
        }
        System.out.println(ret);
    }
}
